package com.itheima.edu.info.test;

public class test03 {

    public static void main(String[] args) {


        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("帖子去游泳");
            }
        });
    }

    /**
     * 使用接口类型作为参数的方法
     * @param swimming
     */
    public static void goSwimming(Swimming swimming) {
        swimming.swim();
    }
}

/*
    游泳接口
 */
interface Swimming {
    void swim();
}

class SwimmingImpl implements Swimming {

    @Override
    public void swim() {
        System.out.println("贴子，去游泳");
    }
}

